package com.yoshino.state;

/**
 * 不能抽奖的状态
 * @author yoshino
 **/
public class NoRaffleState implements State{

    RaffleActivity activity;

    //初始化时传入活动引用，扣除积分后改变其状态
    public NoRaffleState(RaffleActivity activity) {
        this.activity = activity;
    }

    //当前状态可以扣积分，扣除后，将状态设置成可以抽奖状态
    @Override
    public void deduceMoney() {
        System.out.println("扣除积分，可以抽奖了");
        activity.setState(activity.getCanRaffleState());
    }

    // 当前状态不能抽奖
    @Override
    public boolean raffle() {
        System.out.println("扣了积分才能抽奖");
        return false;
    }

    @Override
    public void dispensePrize() {
        System.out.println("不能发奖品");
    }
}
